//
// Created by yyancy on 2019/11/15.
//

#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;


void fill_vector(istream &ist, vector<int> &v, char terminator) {
    for (int i; ist >> i;) {
        v.push_back(i);
    }
    if (ist.eof())return;
    if (ist.bad()) {
        cerr << "ist is bad" << '\n';
        exit(1);
    }
    if (ist.fail()) {
        ist.clear();

        char c;
        ist >> c;
        if (c != terminator) {
            ist.unget();
            ist.clear(ios_base::failbit);
        }
    }
}

void skip_to_int() {
    if (cin.fail()) {
        cin.clear();
        for (char ch; cin >> ch;) {
            if (isdigit(ch) || ch == '-') {
                cin.unget();
                return;
            }
        }
    }
    cout << "no input \n";
    exit(1);
}

void getNumber() {
    cout << "please enter an integer in the range 1 t0 10 (inclusive):\n";
    int n = 0;
    while (true) {
        if (cin >> n) {
            if (n >= 1 && n <= 10)break;
            cout << "Sorry " << n
                 << " is not in the [1:10[ range; please try again\n";
        } else {
            cout << "Sorry,that was not a number;please try again\n";
            skip_to_int();
        }
    }
}

void end_of_loop(istream &ist, char term, const string &message) {
    if (ist.fail()) {
        ist.clear();
        char ch;
        if (ist >> ch && ch == term)return;
        cerr << message << endl;
        exit(1);
    }
}

void get_number2() {
    cin.exceptions(cin.exceptions() | ios_base::badbit);
    for (int c; cin >> c;) {

    }
    end_of_loop(cin, '=', "bad termination of file");
}

int main() {

    get_number2();
//    getNumber();
//    vector<int> a;
//    fill_vector(cin, a, '=');
//    if (!cin) {
//        cerr << "invalid character!" << endl;
//    }

    vector<double> temps;
//    temps.at(2);
//    for (double temp; cin >> temp;) {
//        temps.push_back(temp);
//    }
//    double sum = 0;
//    for (double d:temps) sum += d;
//    cout << "Average temperature: " << sum / temps.size() << "\n";
//
//    cout << "Median temperature: " << temps[temps.size() / 2];
//    string d;
//    cin >> d;
    return 0;
}